import requests
import json
from decryption_data import *
import math
def header():
    headers = {
        'cp-os': 'android',
        'cp-ver': '1.1.45',
        'cp-uuid': '3969ee8a-6680-3223-8bd7-f48e43ea191b',
        'cp-abid': '3-100',
        'cp-channel': 'quick8',
        'cp-time': '1556425865',
        'cp-token': 'A0l-kqE4PcM1JK1BFeDQ0-q2LLqR~YQLVF8l0LceJmM_',
        'cp-oem': 'Xiaomi',
        'cp-sver': '9',
        'cp-sign': 'd58ee706473b44ec3b1089fd75222b73',
        'cp-appid': '800',
        'Host': 'api.kuai8.mobi',
        'Accept-Encoding': 'gzip',
        'User-Agent': 'okhttp/3.3.1',
        'Connection': 'keep-alive'
    }
    return headers
def msg_list():
    smid = 'bloSRtq96litePwnGyB7USXzTstM9AK0'
    msg_voice = requests.get(
        url='http://api.kuai8.mobi/2/message/self.json?count=20&page=1',
        headers=header()
    )
    # print(json.dumps(msg_voice.json(),indent=True,ensure_ascii=False))
    list_num=(len(msg_voice.json()['result']))
    medias=msg_voice.json()['result']
    for media in medias:
        if 5 in media.values():
            # print(media)
            print(json.dumps(media, indent=True, ensure_ascii=False))
            # from_user_suid=suid_acg_new(media['from_user']['suid'])
            # print(from_user_suid)
if __name__ == '__main__':
    msg_list()
